home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’97 / Finder Dungeon / source code / MoreFiles 1.4.6 / Pascal Interfaces / IterateDirectory.p < prev    next >
Encoding:
Text File  |  1997-06-28  |  1.6 KB  |  60 lines  |  [TEXT/MPS ]

  1. UNIT IterateDirectory;
  2.  
  3. {    IterateDirectory: File Manager directory iterator routines.                }
  4. {                                                                            }
  5. {    by Jim Luther                                                            }
  6. {                                                                            }
  7. {    File:        IterateDirectory.p                                            }
  8. {                                                                            }
  9. {    Copyright © 1996 Jim Luther                                                }
  10. {    All rights reserved.                                                    }
  11. {                                                                            }
  12. {    You may incorporate this sample code into your applications without        }
  13. {    restriction, though the sample code has been provided "AS IS" and the    }
  14. {    responsibility for its operation is 100% yours.                            }
  15. {                                                                            }
  16. {    IterateDirectory is designed to drop into the MoreFiles sample code        }
  17. {    library I wrote while in Apple Developer Technical Support                }
  18.  
  19.  
  20. INTERFACE
  21.  
  22.     USES
  23.         Types, Files;
  24.  
  25. {***************************************************************************}
  26.  
  27.  
  28.     TYPE
  29.         IterateFilterProcPtr = ProcPtr;
  30. {    A IterateDirectory IterateFilterProc procedure should have the            }
  31. {    following form:                                                            }
  32. {                                                                            }
  33. {    PROCEDURE MyIterateFilterProcPtr (cpbPtr: CInfoPBRec;                    }
  34. {                                      VAR quitFlag: Boolean;                }
  35. {                                      yourDataPtr: Ptr);                    }
  36.  
  37.  
  38. {***************************************************************************}
  39.  
  40.  
  41.     FUNCTION IterateDirectory (vRefNum: Integer;
  42.                                     dirID: LongInt;
  43.                                     name: StringPtr;
  44.                                     maxLevels: Integer;
  45.                                     iterateFilter: IterateFilterProcPtr;
  46.                                     yourDataPtr: Ptr): OSErr;
  47.  
  48.     FUNCTION FSpIterateDirectory ({CONST}
  49.                                     VAR spec: FSSpec;
  50.                                     maxLevels: Integer;
  51.                                     iterateFilter: IterateFilterProcPtr;
  52.                                     yourDataPtr: Ptr): OSErr;
  53.  
  54.  
  55. {***************************************************************************}
  56.  
  57.  
  58. IMPLEMENTATION
  59.  
  60. END.